﻿using System;

namespace NopSolutions.NopCommerce.Web.Administration.Modules
{
    public partial class DatePicker : BaseNopAdministrationUserControl
    {
        #region Properties
        //public bool ShowTime {
        //    get {
        //        return Convert.ToBoolean(ViewState["ShowTime"]);
        //    }
        //    set {
        //        ViewState["ShowTime"] = value;
        //    }
        //}

        public DateTime? SelectedDate {
            get {
                DateTime inputDate;
                if (!DateTime.TryParse(txtDateTime.Text, out inputDate)) {
                    return null;
                }
                return inputDate;
            }
            set {
                if (value.HasValue) {
                    txtDateTime.Text = value.Value.ToShortDateString();
                    //ajaxCalendar.SelectedDate = value;
                }
            }
        }

        //public string Format {
        //    get {
        //        return ajaxCalendar.Format;
        //    }
        //    set {
        //        ajaxCalendar.Format = value;
        //    }
        //}

        public override string ClientID {
            get {
                return txtDateTime.ClientID;
            }
        }
        #endregion
    }
}